﻿using IQIGame.Onigao.Game;
using System;
using System.Threading.Tasks;

namespace IQIGame.Onigao.GamePlay
{
    public abstract class MessageResult : ISendMessage
    {
        protected int code;
        protected Task future;
        protected Action delayCall;

        public MessageResult() { }

        public MessageResult(int code)
        {
            this.code = code;
        }

        public MessageResult(Task future)
        {
            this.future = future;
        }

        public Action GetDelayCall()
        {
            return delayCall;
        }

        public MessageResult SetDelayCall(Action delayCall)
        {
            this.delayCall = delayCall;
            return this;
        }

        public Task GetFuture()
        {
            return future;
        }

        public MessageResult SetCode(int code)
        {
            this.code= code;
            return this;
        }

        public int GetCode()
        {
            return code;
        }

        public abstract MessageResult GetFutureResult(Task task);
        public abstract SendPackage ToPackage();
        public abstract int GetMessageId();
    }

}
